<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The GRASP/AQUA Project, Glasgow University, 1993-1998

\section{Code output phase}
-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Driver.CodeOutput</span><span>
</span><span id="line-10"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.CodeOutput.html#codeOutput"><span class="hs-identifier">codeOutput</span></a></span><span>
</span><span id="line-11"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputForeignStubs"><span class="hs-identifier">outputForeignStubs</span></a></span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.CodeOutput.html#profilingInitCode"><span class="hs-identifier">profilingInitCode</span></a></span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.html"><span class="hs-identifier">GHC.CmmToAsm</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.html#nativeCodeGen"><span class="hs-identifier">nativeCodeGen</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.html"><span class="hs-identifier">GHC.CmmToLlvm</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.CmmToLlvm.html#llvmCodeGen"><span class="hs-identifier">llvmCodeGen</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier">mkSplitUniqSupply</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html"><span class="hs-identifier">GHC.Driver.Finder</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html#mkStubPaths"><span class="hs-identifier">mkStubPaths</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToC.html"><span class="hs-identifier">GHC.CmmToC</span></a></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.CmmToC.html#writeC"><span class="hs-identifier">writeC</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Lint.html"><span class="hs-identifier">GHC.Cmm.Lint</span></a></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.Lint.html#cmmLint"><span class="hs-identifier">cmmLint</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>              </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier">RawCmmGroup</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html"><span class="hs-identifier">GHC.Data.Stream</span></a></span><span>           </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier">Stream</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html"><span class="hs-identifier">GHC.Data.Stream</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Stream</span></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.SysTools.FileCleanup.html"><span class="hs-identifier">GHC.SysTools.FileCleanup</span></a></span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Steering}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span id="local-6989586621681048026"><span class="annot"><a href="GHC.Driver.CodeOutput.html#codeOutput"><span class="hs-identifier hs-type">codeOutput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-56"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-57"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-58"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-59"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ForeignStubs"><span class="hs-identifier hs-type">ForeignStubs</span></a></span><span>
</span><span id="line-60"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-boot-th/src/GHC.ForeignSrcLang.Type.html#ForeignSrcLang"><span class="hs-identifier hs-type">ForeignSrcLang</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-61"></span><span>           </span><span class="hs-comment">-- ^ additional files to be compiled with the C compiler</span><span>
</span><span id="line-62"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-63"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681048026"><span class="hs-identifier hs-type">a</span></a></span><span>                       </span><span class="hs-comment">-- Compiled C--</span><span>
</span><span id="line-64"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-comment">{-stub_h_exists-}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-comment">{-stub_c_exists-}</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>                  </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-boot-th/src/GHC.ForeignSrcLang.Type.html#ForeignSrcLang"><span class="hs-identifier hs-type">ForeignSrcLang</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-comment">{-foreign_fps-}</span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>                  </span><span class="annot"><a href="#local-6989586621681048026"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span id="codeOutput"><span class="annot"><span class="annottext">codeOutput :: forall a.
DynFlags
-&gt; Module
-&gt; FilePath
-&gt; ModLocation
-&gt; ForeignStubs
-&gt; [(ForeignSrcLang, FilePath)]
-&gt; [UnitId]
-&gt; Stream IO RawCmmGroup a
-&gt; IO
     (FilePath, (Bool, Maybe FilePath), [(ForeignSrcLang, FilePath)], a)
</span><a href="GHC.Driver.CodeOutput.html#codeOutput"><span class="hs-identifier hs-var hs-var">codeOutput</span></a></span></span><span> </span><span id="local-6989586621681047911"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681047910"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047910"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span id="local-6989586621681047909"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047909"><span class="hs-identifier hs-var">filenm</span></a></span></span><span> </span><span id="local-6989586621681047908"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047908"><span class="hs-identifier hs-var">location</span></a></span></span><span> </span><span id="local-6989586621681047907"><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681047907"><span class="hs-identifier hs-var">foreign_stubs</span></a></span></span><span> </span><span id="local-6989586621681047906"><span class="annot"><span class="annottext">[(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681047906"><span class="hs-identifier hs-var">foreign_fps</span></a></span></span><span> </span><span id="local-6989586621681047905"><span class="annot"><span class="annottext">[UnitId]
</span><a href="#local-6989586621681047905"><span class="hs-identifier hs-var">pkg_deps</span></a></span></span><span>
</span><span id="line-70"></span><span>  </span><span id="local-6989586621681047904"><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047904"><span class="hs-identifier hs-var">cmm_stream</span></a></span></span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-glyph">=</span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span>
</span><span id="line-73"></span><span>        </span><span class="hs-comment">-- Lint each CmmGroup as it goes past</span><span>
</span><span id="line-74"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681047898"><span class="annot"><span class="annottext">linted_cmm_stream :: Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047898"><span class="hs-identifier hs-var hs-var">linted_cmm_stream</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-75"></span><span>                 </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_DoCmmLinting"><span class="hs-identifier hs-var">Opt_DoCmmLinting</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-76"></span><span>                    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(RawCmmGroup -&gt; IO RawCmmGroup)
-&gt; Stream IO RawCmmGroup a -&gt; Stream IO RawCmmGroup a
forall (m :: * -&gt; *) a b x.
Monad m =&gt;
(a -&gt; m b) -&gt; Stream m a x -&gt; Stream m b x
</span><a href="GHC.Data.Stream.html#mapM"><span class="hs-identifier hs-var">Stream.mapM</span></a></span><span> </span><span class="annot"><span class="annottext">RawCmmGroup -&gt; IO RawCmmGroup
forall {d} {h}.
(Outputable d, Outputable h) =&gt;
GenCmmGroup d h CmmGraph -&gt; IO (GenCmmGroup d h CmmGraph)
</span><a href="#local-6989586621681047894"><span class="hs-identifier hs-var">do_lint</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047904"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span>
</span><span id="line-77"></span><span>                    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047904"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>              </span><span id="local-6989586621681047894"><span class="annot"><span class="annottext">do_lint :: GenCmmGroup d h CmmGraph -&gt; IO (GenCmmGroup d h CmmGraph)
</span><a href="#local-6989586621681047894"><span class="hs-identifier hs-var hs-var">do_lint</span></a></span></span><span> </span><span id="local-6989586621681047882"><span class="annot"><span class="annottext">GenCmmGroup d h CmmGraph
</span><a href="#local-6989586621681047882"><span class="hs-identifier hs-var">cmm</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; SDoc
-&gt; (GenCmmGroup d h CmmGraph -&gt; ())
-&gt; IO (GenCmmGroup d h CmmGraph)
-&gt; IO (GenCmmGroup d h CmmGraph)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTimingSilent"><span class="hs-identifier hs-var">withTimingSilent</span></a></span><span>
</span><span id="line-80"></span><span>                  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-81"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;CmmLint&quot;</span></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047910"><span class="hs-identifier hs-var">this_mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; GenCmmGroup d h CmmGraph -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO (GenCmmGroup d h CmmGraph) -&gt; IO (GenCmmGroup d h CmmGraph))
-&gt; IO (GenCmmGroup d h CmmGraph) -&gt; IO (GenCmmGroup d h CmmGraph)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-83"></span><span>                </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; GenCmmGroup d h CmmGraph -&gt; Maybe SDoc
forall d h.
(Outputable d, Outputable h) =&gt;
DynFlags -&gt; GenCmmGroup d h CmmGraph -&gt; Maybe SDoc
</span><a href="GHC.Cmm.Lint.html#cmmLint"><span class="hs-identifier hs-var">cmmLint</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGroup d h CmmGraph
</span><a href="#local-6989586621681047882"><span class="hs-identifier hs-var">cmm</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-84"></span><span>                        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681047875"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047875"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; LogAction
</span><a href="GHC.Driver.Session.html#log_action"><span class="hs-identifier hs-var hs-var">log_action</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-85"></span><span>                                                   </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-86"></span><span>                                                   </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span>
</span><span id="line-87"></span><span>                                                   </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevDump"><span class="hs-identifier hs-var">SevDump</span></a></span><span>
</span><span id="line-88"></span><span>                                                   </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-89"></span><span>                                                   </span><span class="annot"><span class="annottext">(SDoc -&gt; IO ()) -&gt; SDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultDumpStyle"><span class="hs-identifier hs-var">defaultDumpStyle</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047875"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-90"></span><span>                                       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; IO ()
</span><a href="GHC.Utils.Error.html#ghcExit"><span class="hs-identifier hs-var">ghcExit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-91"></span><span>                                       </span><span class="hs-special">}</span><span>
</span><span id="line-92"></span><span>                        </span><span class="annot"><span class="annottext">Maybe SDoc
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">GenCmmGroup d h CmmGraph -&gt; IO (GenCmmGroup d h CmmGraph)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">GenCmmGroup d h CmmGraph
</span><a href="#local-6989586621681047882"><span class="hs-identifier hs-var">cmm</span></a></span><span>
</span><span id="line-94"></span><span>                </span><span class="hs-special">}</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681047867"><span class="annot"><span class="annottext">(Bool, Maybe FilePath)
</span><a href="#local-6989586621681047867"><span class="hs-identifier hs-var">stubs_exist</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; ForeignStubs
-&gt; IO (Bool, Maybe FilePath)
</span><a href="GHC.Driver.CodeOutput.html#outputForeignStubs"><span class="hs-identifier hs-var">outputForeignStubs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047910"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047908"><span class="hs-identifier hs-var">location</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681047907"><span class="hs-identifier hs-var">foreign_stubs</span></a></span><span>
</span><span id="line-97"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681047866"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681047866"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-98"></span><span>                 </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscAsm"><span class="hs-identifier hs-var">HscAsm</span></a></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; FilePath
-&gt; Stream IO RawCmmGroup a
-&gt; IO a
forall a.
DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; FilePath
-&gt; Stream IO RawCmmGroup a
-&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#outputAsm"><span class="hs-identifier hs-var">outputAsm</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047910"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047908"><span class="hs-identifier hs-var">location</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047909"><span class="hs-identifier hs-var">filenm</span></a></span><span>
</span><span id="line-99"></span><span>                                             </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047898"><span class="hs-identifier hs-var">linted_cmm_stream</span></a></span><span>
</span><span id="line-100"></span><span>                 </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscC"><span class="hs-identifier hs-var">HscC</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; Stream IO RawCmmGroup a -&gt; [UnitId] -&gt; IO a
forall a.
DynFlags -&gt; FilePath -&gt; Stream IO RawCmmGroup a -&gt; [UnitId] -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#outputC"><span class="hs-identifier hs-var">outputC</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047909"><span class="hs-identifier hs-var">filenm</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047898"><span class="hs-identifier hs-var">linted_cmm_stream</span></a></span><span> </span><span class="annot"><span class="annottext">[UnitId]
</span><a href="#local-6989586621681047905"><span class="hs-identifier hs-var">pkg_deps</span></a></span><span>
</span><span id="line-101"></span><span>                 </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscLlvm"><span class="hs-identifier hs-var">HscLlvm</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; Stream IO RawCmmGroup a -&gt; IO a
forall a. DynFlags -&gt; FilePath -&gt; Stream IO RawCmmGroup a -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#outputLlvm"><span class="hs-identifier hs-var">outputLlvm</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047911"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047909"><span class="hs-identifier hs-var">filenm</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047898"><span class="hs-identifier hs-var">linted_cmm_stream</span></a></span><span>
</span><span id="line-102"></span><span>                 </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscInterpreted"><span class="hs-identifier hs-var">HscInterpreted</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO a
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;codeOutput: HscInterpreted&quot;</span></span><span>
</span><span id="line-103"></span><span>                 </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscNothing"><span class="hs-identifier hs-var">HscNothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO a
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;codeOutput: HscNothing&quot;</span></span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(FilePath, (Bool, Maybe FilePath), [(ForeignSrcLang, FilePath)], a)
-&gt; IO
     (FilePath, (Bool, Maybe FilePath), [(ForeignSrcLang, FilePath)], a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047909"><span class="hs-identifier hs-var">filenm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Bool, Maybe FilePath)
</span><a href="#local-6989586621681047867"><span class="hs-identifier hs-var">stubs_exist</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(ForeignSrcLang, FilePath)]
</span><a href="#local-6989586621681047906"><span class="hs-identifier hs-var">foreign_fps</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681047866"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span id="local-6989586621681047984"><span class="annot"><a href="GHC.Driver.CodeOutput.html#doOutput"><span class="hs-identifier hs-type">doOutput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681047984"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681047984"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-108"></span><span id="doOutput"><span class="annot"><span class="annottext">doOutput :: forall a. FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#doOutput"><span class="hs-identifier hs-var hs-var">doOutput</span></a></span></span><span> </span><span id="local-6989586621681047854"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047854"><span class="hs-identifier hs-var">filenm</span></a></span></span><span> </span><span id="local-6989586621681047853"><span class="annot"><span class="annottext">Handle -&gt; IO a
</span><a href="#local-6989586621681047853"><span class="hs-identifier hs-var">io_action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Handle -&gt; (Handle -&gt; IO ()) -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; IOMode -&gt; IO Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#openFile"><span class="hs-identifier hs-var">openFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047854"><span class="hs-identifier hs-var">filenm</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#WriteMode"><span class="hs-identifier hs-var">WriteMode</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO a
</span><a href="#local-6989586621681047853"><span class="hs-identifier hs-var">io_action</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{C}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span id="local-6989586621681047988"><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputC"><span class="hs-identifier hs-type">outputC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-119"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-120"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681047988"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-121"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-122"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681047988"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span id="outputC"><span class="annot"><span class="annottext">outputC :: forall a.
DynFlags -&gt; FilePath -&gt; Stream IO RawCmmGroup a -&gt; [UnitId] -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#outputC"><span class="hs-identifier hs-var hs-var">outputC</span></a></span></span><span> </span><span id="local-6989586621681047844"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047844"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681047843"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047843"><span class="hs-identifier hs-var">filenm</span></a></span></span><span> </span><span id="local-6989586621681047842"><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047842"><span class="hs-identifier hs-var">cmm_stream</span></a></span></span><span> </span><span id="local-6989586621681047841"><span class="annot"><span class="annottext">[UnitId]
</span><a href="#local-6989586621681047841"><span class="hs-identifier hs-var">packages</span></a></span></span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-126"></span><span>       </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; IO a -&gt; IO a
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var">withTiming</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047844"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;C codegen&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681047839"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681047839"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; () -&gt; ()
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681047839"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">{- FIXME -}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; IO a) -&gt; IO a -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-127"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681047838"><span class="annot"><span class="annottext">pkg_names :: [FilePath]
</span><a href="#local-6989586621681047838"><span class="hs-identifier hs-var hs-var">pkg_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(UnitId -&gt; FilePath) -&gt; [UnitId] -&gt; [FilePath]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; FilePath
</span><a href="GHC.Unit.Types.html#unitIdString"><span class="hs-identifier hs-var">unitIdString</span></a></span><span> </span><span class="annot"><span class="annottext">[UnitId]
</span><a href="#local-6989586621681047841"><span class="hs-identifier hs-var">packages</span></a></span><span>
</span><span id="line-128"></span><span>         </span><span class="annot"><span class="annottext">FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a. FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#doOutput"><span class="hs-identifier hs-var">doOutput</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047843"><span class="hs-identifier hs-var">filenm</span></a></span><span> </span><span class="annot"><span class="annottext">((Handle -&gt; IO a) -&gt; IO a) -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681047836"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047836"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-129"></span><span>            </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047836"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;/* GHC_PACKAGES &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath] -&gt; FilePath
</span><a href="../../base/src/Data.OldList.html#unwords"><span class="hs-identifier hs-var">unwords</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681047838"><span class="hs-identifier hs-var">pkg_names</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\n*/\n&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>            </span><span class="annot"><span class="annottext">Handle -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047836"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#include \&quot;Stg.h\&quot;\n&quot;</span></span><span>
</span><span id="line-131"></span><span>            </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a -&gt; (RawCmmGroup -&gt; IO ()) -&gt; IO a
forall (m :: * -&gt; *) a b.
Monad m =&gt;
Stream m a b -&gt; (a -&gt; m ()) -&gt; m b
</span><a href="GHC.Data.Stream.html#consume"><span class="hs-identifier hs-var">Stream.consume</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047842"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Handle -&gt; RawCmmGroup -&gt; IO ()
</span><a href="GHC.CmmToC.html#writeC"><span class="hs-identifier hs-var">writeC</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047844"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047836"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Assembler}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span id="local-6989586621681047989"><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputAsm"><span class="hs-identifier hs-type">outputAsm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-142"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681047989"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-143"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681047989"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-144"></span><span id="outputAsm"><span class="annot"><span class="annottext">outputAsm :: forall a.
DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; FilePath
-&gt; Stream IO RawCmmGroup a
-&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#outputAsm"><span class="hs-identifier hs-var hs-var">outputAsm</span></a></span></span><span> </span><span id="local-6989586621681047830"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047830"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681047829"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047829"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span id="local-6989586621681047828"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047828"><span class="hs-identifier hs-var">location</span></a></span></span><span> </span><span id="local-6989586621681047827"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047827"><span class="hs-identifier hs-var">filenm</span></a></span></span><span> </span><span id="local-6989586621681047826"><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047826"><span class="hs-identifier hs-var">cmm_stream</span></a></span></span><span>
</span><span id="line-145"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681047825"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681047825"><span class="hs-identifier hs-var">ncg_uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'n'</span></span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span>       </span><span class="annot"><span class="annottext">DynFlags -&gt; Int -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#debugTraceMsg"><span class="hs-identifier hs-var">debugTraceMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047830"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Outputing asm to&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047827"><span class="hs-identifier hs-var">filenm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>       </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;OutputAsm&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a. FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#doOutput"><span class="hs-identifier hs-var">doOutput</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047827"><span class="hs-identifier hs-var">filenm</span></a></span><span> </span><span class="annot"><span class="annottext">((Handle -&gt; IO a) -&gt; IO a) -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-150"></span><span>           </span><span class="hs-glyph">\</span><span id="local-6989586621681047823"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047823"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;NativeCodeGen&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-151"></span><span>                 </span><span class="annot"><span class="annottext">DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; Handle
-&gt; UniqSupply
-&gt; Stream IO RawCmmGroup a
-&gt; IO a
forall a.
DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; Handle
-&gt; UniqSupply
-&gt; Stream IO RawCmmGroup a
-&gt; IO a
</span><a href="GHC.CmmToAsm.html#nativeCodeGen"><span class="hs-identifier hs-var">nativeCodeGen</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047830"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047829"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047828"><span class="hs-identifier hs-var">location</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047823"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681047825"><span class="hs-identifier hs-var">ncg_uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047826"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{LLVM}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span id="local-6989586621681047987"><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputLlvm"><span class="hs-identifier hs-type">outputLlvm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Stream.html#Stream"><span class="hs-identifier hs-type">Stream</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Cmm.html#RawCmmGroup"><span class="hs-identifier hs-type">RawCmmGroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681047987"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681047987"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-162"></span><span id="outputLlvm"><span class="annot"><span class="annottext">outputLlvm :: forall a. DynFlags -&gt; FilePath -&gt; Stream IO RawCmmGroup a -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#outputLlvm"><span class="hs-identifier hs-var hs-var">outputLlvm</span></a></span></span><span> </span><span id="local-6989586621681047822"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047822"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681047821"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047821"><span class="hs-identifier hs-var">filenm</span></a></span></span><span> </span><span id="local-6989586621681047820"><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047820"><span class="hs-identifier hs-var">cmm_stream</span></a></span></span><span>
</span><span id="line-163"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;llvm_output&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a. FilePath -&gt; (Handle -&gt; IO a) -&gt; IO a
</span><a href="GHC.Driver.CodeOutput.html#doOutput"><span class="hs-identifier hs-var">doOutput</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047821"><span class="hs-identifier hs-var">filenm</span></a></span><span> </span><span class="annot"><span class="annottext">((Handle -&gt; IO a) -&gt; IO a) -&gt; (Handle -&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-164"></span><span>           </span><span class="hs-glyph">\</span><span id="local-6989586621681047819"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047819"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;llvm_CodeGen&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-165"></span><span>                 </span><span class="annot"><span class="annottext">DynFlags -&gt; Handle -&gt; Stream IO RawCmmGroup a -&gt; IO a
forall a. DynFlags -&gt; Handle -&gt; Stream IO RawCmmGroup a -&gt; IO a
</span><a href="GHC.CmmToLlvm.html#llvmCodeGen"><span class="hs-identifier hs-var">llvmCodeGen</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047822"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621681047819"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Stream IO RawCmmGroup a
</span><a href="#local-6989586621681047820"><span class="hs-identifier hs-var">cmm_stream</span></a></span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Foreign import/export}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputForeignStubs"><span class="hs-identifier hs-type">outputForeignStubs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ForeignStubs"><span class="hs-identifier hs-type">ForeignStubs</span></a></span><span>
</span><span id="line-176"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- Header file created</span><span>
</span><span id="line-177"></span><span>                          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- C file created</span><span>
</span><span id="line-178"></span><span id="outputForeignStubs"><span class="annot"><span class="annottext">outputForeignStubs :: DynFlags
-&gt; Module
-&gt; ModLocation
-&gt; ForeignStubs
-&gt; IO (Bool, Maybe FilePath)
</span><a href="GHC.Driver.CodeOutput.html#outputForeignStubs"><span class="hs-identifier hs-var hs-var">outputForeignStubs</span></a></span></span><span> </span><span id="local-6989586621681047818"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681047817"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047817"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681047816"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047816"><span class="hs-identifier hs-var">location</span></a></span></span><span> </span><span id="local-6989586621681047815"><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681047815"><span class="hs-identifier hs-var">stubs</span></a></span></span><span>
</span><span id="line-179"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-180"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681047814"><span class="annot"><span class="annottext">stub_h :: FilePath
</span><a href="#local-6989586621681047814"><span class="hs-identifier hs-var hs-var">stub_h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; ModLocation -&gt; FilePath
</span><a href="GHC.Driver.Finder.html#mkStubPaths"><span class="hs-identifier hs-var">mkStubPaths</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047817"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681047816"><span class="hs-identifier hs-var">location</span></a></span><span>
</span><span id="line-181"></span><span>   </span><span id="local-6989586621681047812"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047812"><span class="hs-identifier hs-var">stub_c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; TempFileLifetime -&gt; FilePath -&gt; IO FilePath
</span><a href="GHC.SysTools.FileCleanup.html#newTempName"><span class="hs-identifier hs-var">newTempName</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileLifetime
</span><a href="GHC.SysTools.FileCleanup.html#TFL_CurrentModule"><span class="hs-identifier hs-var">TFL_CurrentModule</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;c&quot;</span></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ForeignStubs
</span><a href="#local-6989586621681047815"><span class="hs-identifier hs-var">stubs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-184"></span><span>     </span><span class="annot"><span class="annottext">ForeignStubs
</span><a href="GHC.Driver.Types.html#NoStubs"><span class="hs-identifier hs-var">NoStubs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-185"></span><span>        </span><span class="annot"><span class="annottext">(Bool, Maybe FilePath) -&gt; IO (Bool, Maybe FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span>     </span><span class="annot"><a href="GHC.Driver.Types.html#ForeignStubs"><span class="hs-identifier hs-type">ForeignStubs</span></a></span><span> </span><span id="local-6989586621681047807"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047807"><span class="hs-identifier hs-var">h_code</span></a></span></span><span> </span><span id="local-6989586621681047806"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047806"><span class="hs-identifier hs-var">c_code</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-188"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-189"></span><span>            </span><span id="local-6989586621681047805"><span class="annot"><span class="annottext">stub_c_output_d :: SDoc
</span><a href="#local-6989586621681047805"><span class="hs-identifier hs-var hs-var">stub_c_output_d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeStyle -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprCode"><span class="hs-identifier hs-var">pprCode</span></a></span><span> </span><span class="annot"><span class="annottext">CodeStyle
</span><a href="GHC.Utils.Outputable.html#CStyle"><span class="hs-identifier hs-var">CStyle</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047806"><span class="hs-identifier hs-var">c_code</span></a></span><span>
</span><span id="line-190"></span><span>            </span><span id="local-6989586621681047802"><span class="annot"><span class="annottext">stub_c_output_w :: FilePath
</span><a href="#local-6989586621681047802"><span class="hs-identifier hs-var hs-var">stub_c_output_w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047805"><span class="hs-identifier hs-var">stub_c_output_d</span></a></span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span>            </span><span class="hs-comment">-- Header file protos for &quot;foreign export&quot;ed functions.</span><span>
</span><span id="line-193"></span><span>            </span><span id="local-6989586621681047800"><span class="annot"><span class="annottext">stub_h_output_d :: SDoc
</span><a href="#local-6989586621681047800"><span class="hs-identifier hs-var hs-var">stub_h_output_d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CodeStyle -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprCode"><span class="hs-identifier hs-var">pprCode</span></a></span><span> </span><span class="annot"><span class="annottext">CodeStyle
</span><a href="GHC.Utils.Outputable.html#CStyle"><span class="hs-identifier hs-var">CStyle</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047807"><span class="hs-identifier hs-var">h_code</span></a></span><span>
</span><span id="line-194"></span><span>            </span><span id="local-6989586621681047799"><span class="annot"><span class="annottext">stub_h_output_w :: FilePath
</span><a href="#local-6989586621681047799"><span class="hs-identifier hs-var hs-var">stub_h_output_w</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047800"><span class="hs-identifier hs-var">stub_h_output_d</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; FilePath -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#createDirectoryIfMissing"><span class="hs-identifier hs-var">createDirectoryIfMissing</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#takeDirectory"><span class="hs-identifier hs-var">takeDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047814"><span class="hs-identifier hs-var">stub_h</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; FilePath -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_foreign"><span class="hs-identifier hs-var">Opt_D_dump_foreign</span></a></span><span>
</span><span id="line-199"></span><span>                      </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Foreign export header file&quot;</span></span><span>
</span><span id="line-200"></span><span>                      </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatC"><span class="hs-identifier hs-var">FormatC</span></a></span><span>
</span><span id="line-201"></span><span>                      </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047800"><span class="hs-identifier hs-var">stub_h_output_d</span></a></span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">-- we need the #includes from the rts package for the stub files</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681047791"><span class="annot"><span class="annottext">rts_includes :: FilePath
</span><a href="#local-6989586621681047791"><span class="hs-identifier hs-var hs-var">rts_includes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-205"></span><span>               </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681047788"><span class="annot"><span class="annottext">rts_pkg :: UnitInfo
</span><a href="#local-6989586621681047788"><span class="hs-identifier hs-var hs-var">rts_pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; UnitState -&gt; UnitId -&gt; UnitInfo
UnitState -&gt; UnitId -&gt; UnitInfo
</span><a href="GHC.Unit.State.html#unsafeLookupUnitId"><span class="hs-identifier hs-var">unsafeLookupUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#rtsUnitId"><span class="hs-identifier hs-var">rtsUnitId</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-206"></span><span>               </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath) -&gt; [FilePath] -&gt; FilePath
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621681047783"><span class="hs-identifier hs-var">mk_include</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitInfo -&gt; [FilePath]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitIncludes"><span class="hs-identifier hs-var hs-var">unitIncludes</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621681047788"><span class="hs-identifier hs-var">rts_pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>            </span><span id="local-6989586621681047783"><span class="annot"><span class="annottext">mk_include :: FilePath -&gt; FilePath
</span><a href="#local-6989586621681047783"><span class="hs-identifier hs-var hs-var">mk_include</span></a></span></span><span> </span><span id="local-6989586621681047781"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047781"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#include \&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047781"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\&quot;\n&quot;</span></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>            </span><span class="hs-comment">-- wrapper code mentions the ffi_arg type, which comes from ffi.h</span><span>
</span><span id="line-210"></span><span>            </span><span id="local-6989586621681047780"><span class="annot"><span class="annottext">ffi_includes :: FilePath
</span><a href="#local-6989586621681047780"><span class="hs-identifier hs-var hs-var">ffi_includes</span></a></span></span><span>
</span><span id="line-211"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">PlatformMisc -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformMisc_libFFI"><span class="hs-identifier hs-var hs-var">platformMisc_libFFI</span></a></span><span> </span><span class="annot"><span class="annottext">(PlatformMisc -&gt; Bool) -&gt; PlatformMisc -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; PlatformMisc
</span><a href="GHC.Driver.Session.html#platformMisc"><span class="hs-identifier hs-var hs-var">platformMisc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#include &lt;ffi.h&gt;\n&quot;</span></span><span>
</span><span id="line-212"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span>        </span><span id="local-6989586621681047777"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681047777"><span class="hs-identifier hs-var">stub_h_file_exists</span></a></span></span><span>
</span><span id="line-215"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath -&gt; FilePath -&gt; IO Bool
</span><a href="GHC.Driver.CodeOutput.html#outputForeignStubs_help"><span class="hs-identifier hs-var">outputForeignStubs_help</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047814"><span class="hs-identifier hs-var">stub_h</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047799"><span class="hs-identifier hs-var">stub_h_output_w</span></a></span><span>
</span><span id="line-216"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#include &lt;HsFFI.h&gt;\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047775"><span class="hs-identifier hs-var">cplusplus_hdr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047774"><span class="hs-identifier hs-var">cplusplus_ftr</span></a></span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; FilePath -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681047818"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_foreign"><span class="hs-identifier hs-var">Opt_D_dump_foreign</span></a></span><span>
</span><span id="line-219"></span><span>                      </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Foreign export stubs&quot;</span></span><span> </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatC"><span class="hs-identifier hs-var">FormatC</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047805"><span class="hs-identifier hs-var">stub_c_output_d</span></a></span><span>
</span><span id="line-220"></span><span>
</span><span id="line-221"></span><span>        </span><span id="local-6989586621681047773"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681047773"><span class="hs-identifier hs-var">stub_c_file_exists</span></a></span></span><span>
</span><span id="line-222"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath -&gt; FilePath -&gt; IO Bool
</span><a href="GHC.Driver.CodeOutput.html#outputForeignStubs_help"><span class="hs-identifier hs-var">outputForeignStubs_help</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047812"><span class="hs-identifier hs-var">stub_c</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047802"><span class="hs-identifier hs-var">stub_c_output_w</span></a></span><span>
</span><span id="line-223"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#define IN_STG_CODE 0\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-224"></span><span>                 </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#include &lt;Rts.h&gt;\n&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-225"></span><span>                 </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047791"><span class="hs-identifier hs-var">rts_includes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-226"></span><span>                 </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047780"><span class="hs-identifier hs-var">ffi_includes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-227"></span><span>                 </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047775"><span class="hs-identifier hs-var">cplusplus_hdr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>                 </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047774"><span class="hs-identifier hs-var">cplusplus_ftr</span></a></span><span>
</span><span id="line-229"></span><span>           </span><span class="hs-comment">-- We're adding the default hc_header to the stub file, but this</span><span>
</span><span id="line-230"></span><span>           </span><span class="hs-comment">-- isn't really HC code, so we need to define IN_STG_CODE==0 to</span><span>
</span><span id="line-231"></span><span>           </span><span class="hs-comment">-- avoid the register variables etc. being enabled.</span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span>        </span><span class="annot"><span class="annottext">(Bool, Maybe FilePath) -&gt; IO (Bool, Maybe FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681047777"><span class="hs-identifier hs-var">stub_h_file_exists</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681047773"><span class="hs-identifier hs-var">stub_c_file_exists</span></a></span><span>
</span><span id="line-234"></span><span>                                       </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047812"><span class="hs-identifier hs-var">stub_c</span></a></span><span>
</span><span id="line-235"></span><span>                                       </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-236"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-237"></span><span>   </span><span id="local-6989586621681047775"><span class="annot"><span class="annottext">cplusplus_hdr :: FilePath
</span><a href="#local-6989586621681047775"><span class="hs-identifier hs-var hs-var">cplusplus_hdr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#if defined(__cplusplus)\nextern \&quot;C\&quot; {\n#endif\n&quot;</span></span><span>
</span><span id="line-238"></span><span>   </span><span id="local-6989586621681047774"><span class="annot"><span class="annottext">cplusplus_ftr :: FilePath
</span><a href="#local-6989586621681047774"><span class="hs-identifier hs-var hs-var">cplusplus_ftr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;#if defined(__cplusplus)\n}\n#endif\n&quot;</span></span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="hs-comment">-- Don't use doOutput for dumping the f. export stubs</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- since it is more than likely that the stubs file will</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- turn out to be empty, in which case no file should be created.</span><span>
</span><span id="line-244"></span><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputForeignStubs_help"><span class="hs-identifier hs-type">outputForeignStubs_help</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-245"></span><span id="outputForeignStubs_help"><span class="annot"><span class="annottext">outputForeignStubs_help :: FilePath -&gt; FilePath -&gt; FilePath -&gt; FilePath -&gt; IO Bool
</span><a href="GHC.Driver.CodeOutput.html#outputForeignStubs_help"><span class="hs-identifier hs-var hs-var">outputForeignStubs_help</span></a></span></span><span> </span><span id="local-6989586621681047772"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047772"><span class="hs-identifier hs-var">_fname</span></a></span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>      </span><span id="local-6989586621681047771"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047771"><span class="hs-identifier hs-var">_header</span></a></span></span><span> </span><span id="local-6989586621681047770"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047770"><span class="hs-identifier hs-var">_footer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-246"></span><span class="annot"><a href="GHC.Driver.CodeOutput.html#outputForeignStubs_help"><span class="hs-identifier hs-var">outputForeignStubs_help</span></a></span><span> </span><span id="local-6989586621681047769"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047769"><span class="hs-identifier hs-var">fname</span></a></span></span><span> </span><span id="local-6989586621681047768"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047768"><span class="hs-identifier hs-var">doc_str</span></a></span></span><span> </span><span id="local-6989586621681047767"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047767"><span class="hs-identifier hs-var">header</span></a></span></span><span> </span><span id="local-6989586621681047766"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047766"><span class="hs-identifier hs-var">footer</span></a></span></span><span>
</span><span id="line-247"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; IO ()
</span><a href="../../base/src/System.IO.html#writeFile"><span class="hs-identifier hs-var">writeFile</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047769"><span class="hs-identifier hs-var">fname</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047767"><span class="hs-identifier hs-var">header</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047768"><span class="hs-identifier hs-var">doc_str</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="annot"><span class="annottext">Char -&gt; FilePath -&gt; FilePath
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681047766"><span class="hs-identifier hs-var">footer</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\n&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-251"></span><span class="hs-comment">-- Initialising cost centres</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span class="hs-comment">-- We must produce declarations for the cost-centres defined in this</span><span>
</span><span id="line-254"></span><span class="hs-comment">-- module;</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span class="hs-comment">-- | Generate code to initialise cost centres</span><span>
</span><span id="line-257"></span><span class="annot"><a href="GHC.Driver.CodeOutput.html#profilingInitCode"><span class="hs-identifier hs-type">profilingInitCode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CollectedCCs"><span class="hs-identifier hs-type">CollectedCCs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-258"></span><span id="profilingInitCode"><span class="annot"><span class="annottext">profilingInitCode :: Module -&gt; CollectedCCs -&gt; SDoc
</span><a href="GHC.Driver.CodeOutput.html#profilingInitCode"><span class="hs-identifier hs-var hs-var">profilingInitCode</span></a></span></span><span> </span><span id="local-6989586621681047764"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047764"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681047763"><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681047763"><span class="hs-identifier hs-var">local_CCs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681047762"><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681047762"><span class="hs-identifier hs-var">singleton_CCSs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-260"></span><span>    </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>  </span><span class="annot"><span class="annottext">(CostCentre -&gt; SDoc) -&gt; [CostCentre] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; SDoc
</span><a href="#local-6989586621681047760"><span class="hs-identifier hs-var">emit_cc_decl</span></a></span><span> </span><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681047763"><span class="hs-identifier hs-var">local_CCs</span></a></span><span>
</span><span id="line-261"></span><span>    </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(CostCentreStack -&gt; SDoc) -&gt; [CostCentreStack] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; SDoc
</span><a href="#local-6989586621681047759"><span class="hs-identifier hs-var">emit_ccs_decl</span></a></span><span> </span><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681047762"><span class="hs-identifier hs-var">singleton_CCSs</span></a></span><span>
</span><span id="line-262"></span><span>    </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[CostCentre] -&gt; SDoc
</span><a href="#local-6989586621681047758"><span class="hs-identifier hs-var">emit_cc_list</span></a></span><span> </span><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681047763"><span class="hs-identifier hs-var">local_CCs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-263"></span><span>    </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[CostCentreStack] -&gt; SDoc
</span><a href="#local-6989586621681047757"><span class="hs-identifier hs-var">emit_ccs_list</span></a></span><span> </span><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681047762"><span class="hs-identifier hs-var">singleton_CCSs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-264"></span><span>    </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;static void prof_init_&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047764"><span class="hs-identifier hs-var">this_mod</span></a></span><span>
</span><span id="line-265"></span><span>            </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;(void) __attribute__((constructor));&quot;</span></span><span>
</span><span id="line-266"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;static void prof_init_&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047764"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;(void)&quot;</span></span><span>
</span><span id="line-267"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-268"></span><span>                 </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;registerCcList&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047753"><span class="hs-identifier hs-var">local_cc_list_label</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#semi"><span class="hs-identifier hs-var">semi</span></a></span><span>
</span><span id="line-269"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;registerCcsList&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047751"><span class="hs-identifier hs-var">singleton_cc_list_label</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#semi"><span class="hs-identifier hs-var">semi</span></a></span><span>
</span><span id="line-270"></span><span>                 </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>       </span><span class="hs-special">]</span><span>
</span><span id="line-272"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-273"></span><span>   </span><span id="local-6989586621681047760"><span class="annot"><span class="annottext">emit_cc_decl :: CostCentre -&gt; SDoc
</span><a href="#local-6989586621681047760"><span class="hs-identifier hs-var hs-var">emit_cc_decl</span></a></span></span><span> </span><span id="local-6989586621681047750"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681047750"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-274"></span><span>       </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;extern CostCentre&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047749"><span class="hs-identifier hs-var">cc_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;[];&quot;</span></span><span>
</span><span id="line-275"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681047749"><span class="annot"><span class="annottext">cc_lbl :: SDoc
</span><a href="#local-6989586621681047749"><span class="hs-identifier hs-var hs-var">cc_lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCLabel"><span class="hs-identifier hs-var">mkCCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681047750"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-276"></span><span>   </span><span id="local-6989586621681047753"><span class="annot"><span class="annottext">local_cc_list_label :: SDoc
</span><a href="#local-6989586621681047753"><span class="hs-identifier hs-var hs-var">local_cc_list_label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;local_cc_&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047764"><span class="hs-identifier hs-var">this_mod</span></a></span><span>
</span><span id="line-277"></span><span>   </span><span id="local-6989586621681047758"><span class="annot"><span class="annottext">emit_cc_list :: [CostCentre] -&gt; SDoc
</span><a href="#local-6989586621681047758"><span class="hs-identifier hs-var hs-var">emit_cc_list</span></a></span></span><span> </span><span id="local-6989586621681047743"><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681047743"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-278"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;static CostCentre *&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047753"><span class="hs-identifier hs-var">local_cc_list_label</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;[] =&quot;</span></span><span>
</span><span id="line-279"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCLabel"><span class="hs-identifier hs-var">mkCCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681047742"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span>
</span><span id="line-280"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681047742"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681047742"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681047743"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-281"></span><span>                         </span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;NULL&quot;</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#semi"><span class="hs-identifier hs-var">semi</span></a></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span>   </span><span id="local-6989586621681047759"><span class="annot"><span class="annottext">emit_ccs_decl :: CostCentreStack -&gt; SDoc
</span><a href="#local-6989586621681047759"><span class="hs-identifier hs-var hs-var">emit_ccs_decl</span></a></span></span><span> </span><span id="local-6989586621681047740"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681047740"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-285"></span><span>       </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;extern CostCentreStack&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047739"><span class="hs-identifier hs-var">ccs_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;[];&quot;</span></span><span>
</span><span id="line-286"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681047739"><span class="annot"><span class="annottext">ccs_lbl :: SDoc
</span><a href="#local-6989586621681047739"><span class="hs-identifier hs-var hs-var">ccs_lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentreStack -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCSLabel"><span class="hs-identifier hs-var">mkCCSLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681047740"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-287"></span><span>   </span><span id="local-6989586621681047751"><span class="annot"><span class="annottext">singleton_cc_list_label :: SDoc
</span><a href="#local-6989586621681047751"><span class="hs-identifier hs-var hs-var">singleton_cc_list_label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;singleton_cc_&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681047764"><span class="hs-identifier hs-var">this_mod</span></a></span><span>
</span><span id="line-288"></span><span>   </span><span id="local-6989586621681047757"><span class="annot"><span class="annottext">emit_ccs_list :: [CostCentreStack] -&gt; SDoc
</span><a href="#local-6989586621681047757"><span class="hs-identifier hs-var hs-var">emit_ccs_list</span></a></span></span><span> </span><span id="local-6989586621681047734"><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681047734"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-289"></span><span>      </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;static CostCentreStack *&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681047751"><span class="hs-identifier hs-var">singleton_cc_list_label</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;[] =&quot;</span></span><span>
</span><span id="line-290"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentreStack -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCSLabel"><span class="hs-identifier hs-var">mkCCSLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681047733"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span>
</span><span id="line-291"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681047733"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681047733"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681047734"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-292"></span><span>                         </span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;NULL&quot;</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#semi"><span class="hs-identifier hs-var">semi</span></a></span><span>
</span><span id="line-294"></span></pre></body></html>